package org.yaukie.helper;

import org.yaukie.constant.MyJobConstant;
import org.yaukie.util.PropsUtil;

import java.util.Properties;


/**
 * @Author: yuenbin
 * @Date :2020/5/15
 * @Time :10:12
 * @Motto: It is better to be clear than to be clever !
 * @Destrib: 助手类
 **/
public final class ConfigHelper {

    private static    Properties PROP = PropsUtil.loadProps(MyJobConstant.CONFIG_FILE);

    /**
     * 获取应用基础包名
     *
     * @return
     */
    public static String getAppBasePackage() {
        return PropsUtil.getString(PROP, MyJobConstant.APP_PACKAGE);
    }

    /**
     *  定时器是否随应用启动
     *  默认是false
     * @return
     */
    public static boolean isAutoOn(){
        return PropsUtil.getBoolean(PROP, MyJobConstant.IS_AUTO_ON, false);
    }


    public static String getString(String key) {
        return PropsUtil.getString(PROP, key);
    }

    public static int getInt(String key) {
        return PropsUtil.getInt(PROP, key);
    }

    public static boolean getBoolean(String key) {
        return PropsUtil.getBoolean(PROP, key);
    }

}
